package com.work.model.builder;

import java.util.Date;

import com.work.model.Releases;
import com.work.model.User;

public class ReleasBuilder extends Builder<Releases>{

	private ReleasBuilder withCreatedBy(User createdBy) {
		build().setUserCreatedBy(createdBy);
		return this;
	}
	
	private ReleasBuilder withCreationDate(Date creationDate) {
		build().setCreationDate(creationDate);
		return this;
	}
	
	private ReleasBuilder withRelease(int idReleases) {
		build().setIdReleases(idReleases);
		return this;
	}
	
	private ReleasBuilder withReleaseNb(int releaseNb) {
		build().setReleaseNb(releaseNb);
		return this;
	}
	
	private ReleasBuilder withReleasePhase(String releasePhase) {
		build().setReleasePhase(releasePhase);
		return this;
	}
	
	private ReleasBuilder withUpdatedBy(User updatedBy) {
		build().setUserUpdatedBy(updatedBy);
		return this;
	}
	
	private ReleasBuilder withUpdatedDate(Date updatedDate) {
		build().setUpdatedDate(updatedDate);
		return this;
	}
	
	private ReleasBuilder withYear(String year) {
		build().setYear(year);
		return this;
	}
	

	public Releases aReleas(User createdBy, Date creationDate, int idReleases, int releaseNb, String releasePhase, User updatedBy, Date updatedDate, String year) {
		this.withCreatedBy(createdBy);
		this.withCreationDate(creationDate);
		if (0 != idReleases) {
			this.withRelease(idReleases);
		}
		this.withReleaseNb(releaseNb);
		this.withReleasePhase(releasePhase);
		this.withUpdatedBy(updatedBy);
		this.withUpdatedDate(updatedDate);
		this.withYear(year);
		return this.build();
	}
	
}
